#!/usr/bin/env python
import sys

try:
    import retask.queue

    queue = retask.queue.Queue('fedora-packages')
    queue.connect()

    items = queue.length
    if items > 500:
        print "CRITICAL:  %i tasks in fcomm queue" % items
        sys.exit(2)
    elif items > 250:
        print "WARNING:  %i tasks in fcomm queue" % items
        sys.exit(1)
    else:
        print "OK:  %i tasks in fcomm queue" % items
        sys.exit(0)

except Exception as e:
    print "UNKNOWN:", str(e)
    sys.exit(3)
